<?php $this->headTitle($this->headtitle,'SET'); ?>

<?php 
	if($this->object != null){
?>
<h1><?php echo $this->object->name; ?></h1>
<div class="row">
<div class="span8">
<div id="myCarousel" class="carousel slide">
    <!-- Carousel items -->
    <div class="carousel-inner">
<?php 	
$active = 'active ';
		foreach ($this->object->images as $image)
		{
			
?>
	<div class="<?php echo $active; ?>item"><a class="thumbnail" href="#" ><img alt="#" src="<?php echo '/tradeNetwork/application/'.$image->url;?>"></a></div>
<?php 
			if($active == 'active ')
				$active = '';
		}
?>
    
    
    </div>
    <!-- Carousel nav -->
    <a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a>
    <a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a>
</div>
</div>

<div class="span4">
<?php if($this->activeOffer){?>

    <div class="btn-group">
    <a class="btn btn-primary" href="#">€ Offer</a>
    <a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
    <ul class="dropdown-menu">
    <li><a href="<?php echo $this->saleLink; ?>"><i class="icon-shopping-cart"></i> <?php echo $this->translate('Sale');?></a></li>
    <li><a href="<?php echo $this->rentLink; ?>"><i class="icon-shopping-cart"></i> <?php echo $this->translate('Rent');?></a></li>
    </ul>
    </div>
<br>
<?php }?>

<?php if($this->offer != null){?>
<table class="table table-bordered">
<thead>
	<tr><th colspan="2"><?php echo $this->offerType; ?> 
	
	<?php if($this->isRent == true){ echo 'by '.$this->offer->period; } ?></th></tr>
</thead>
<tbody>
	<tr><td>Price: </td><td><?php echo $this->offer->price; ?></td></tr>
	<tr><td>Start date: </td><td><?php echo $this->offer->start_date; ?></td></tr>
	<tr><td>End date: </td><td><?php echo $this->offer->end_date; ?></td></tr>
	<tr><td colspan="2">Description: <?php echo $this->offer->description; ?></td></tr>
</tbody>
</table>

<?php }?>
<table class="table table-bordered">
<thead><tr><th colspan="2">Information:</th></tr></thead>
<tbody><tr><td>Model: </td><td><?php echo $this->object->model; ?></td></tr>

<tr><td>Brand: </td><td><?php echo $this->object->brand; ?></td></tr>
<tr><td>Year: </td><td><?php echo $this->object->year; ?></td></tr>
<tr><td>Mileage: </td><td><?php echo $this->object->mileage; ?></td></tr>
<tr><td>Cylinder: </td><td><?php echo $this->object->cylinder; ?></td></tr>
</tbody>
</table>

</div>
</div>
<div class="thumbnail">
<p>Description: <?php echo $this->object->description; ?></p>
</div>

<?php 
		
	}
?>
<?php if(!empty($this->alert)):?>
<div class="alert alert-error">
<button class="close" data-dismiss="alert" type="button">×</button>
<?php 	echo $this->alert; ?>
</div>
<?php endif;?>
